package com.example.huangbei.dispatcher;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.dispatcher.DispatchFactory;

/**
 * Created by huangbei on 2017/9/11.
 */

public class SecondActivity extends Activity implements View.OnClickListener{

    private Button jump_btn;
    private TextView textView;
    private DispatchFactory dispatcher;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);

        jump_btn = (Button)findViewById(R.id.jump_btn_02);
        jump_btn.setOnClickListener(this);

        textView = (TextView)findViewById(R.id.parameter_txv);

        dispatcher = DispatchFactory.getInstance();

        Bundle bundle = this.getIntent().getExtras();
        String str1 = bundle.getString("parameter01");
        String str2 = bundle.getString("parameter02");
        String str3 = bundle.getString("parameter03");

        textView.setText(str1+str2+str3);
    }

    @Override
    public void onClick(View view) {
        if(view == jump_btn){
            dispatcher.jump(this,"test01");
            //this.setResult(5);
            //this.finish();
        }
    }

}
